execute if entity @e[tag=StreamBarrierSpawner.entity,distance=..3] run function vs:system/game_ctrol/stream_barrier_spawner/kill

execute align xyz run summon shulker ~0.5 ~1 ~0.5 {Tags:["StreamBarrierSpawner.shulker",StreamBarrierSpawner.entity,"GameCtrol"],NoAI:1b,Silent:true,Invulnerable:true,attributes:[{base:1.01,id:"generic.scale"}],active_effects:[{amplifier:0b,id:"invisibility",duration:-1,show_particles:false,show_icon:false}],DeathLootTable:"empty"}
$execute align xyz run summon marker ~0.5 ~ ~0.5 {Tags:["PowerUsed","$(teamTag)","StreamBarrierSpawner","StreamBarrierSpawner.entity","isEnable",summon,"DropBattery","GameCtrol"]}
execute as @n[tag=summon,type=marker,distance=..2] at @s run function vs:system/game_ctrol/stream_barrier_spawner/enable
execute store result entity @n[tag=summon,type=marker,distance=..2] data.Health int 1 run function vs:system/game/rules/get_value {index:{id:"stream_barrier_spawner_max_health"}}

execute align xyz run summon interaction ~0.5 ~1 ~0.5 {Tags:["StreamBarrierSpawner.entity","StreamBarrierSpawner.hitbox","GameCtrol"],height:1.05,width:1.05,response:true}

execute align xyz run summon text_display ~0.5 ~2.5 ~0.5 {Tags:["StreamBarrierSpawner.entity","StreamBarrierSpawner.text","GameCtrol"],billboard:"center"}

scoreboard players set @n[distance=..2,tag=summon,type=marker] Power 200
setblock ~ ~1 ~ beacon
setblock ~ ~ ~ dispenser[facing=up,triggered=true]{CustomName:'[{"text": "电池仓","color": "yellow"},{"text": "(将电池至于中心)","color": "dark_gray"}]'}

tag @n[distance=..2,tag=summon,type=marker] remove summon
